<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/jquery.confirm.css"/>
	</head>
	<body>
		<div class="am-g">
			 {include file='../Common/hy_header.html'}
			 <form id="formsearch" >
			<div class="am-u-md-6 am-cf">
				<div class="am-fl" style="padding:10px;">
		          <div class="am-input-group am-input-group-sm">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">时间</span>
		          		<input value="{$total.startTime}" style="width:180px;" type="text" id="startTime" name="startTime" class="field am-form-field" placeholder="时：分：秒">
		          </div>
		        </div>
				<div class="am-fl" style="padding:10px;">
		          <div class="am-input-group am-input-group-sm">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">至&nbsp;&nbsp;&nbsp;</span>
		          		<input value="{$total.endTime}" style="width:180px;" type="text" id="endTime" name="endTime" class="field am-form-field " placeholder="时：分：秒">
		          </div>
				  <div class="am-input-group am-input-group-sm">
		                <span class="am-input-group-btn" style=" height: 45px;padding-left: 50px;">
		                  <button class="am-btn am-btn-default bin-select-searchbtn" type="button">搜索</button>
		                </span>
		          </div>
		        </div>
		</form>
	  	<div class="am-btn-toolbar am-fl">
            <div class="am-btn-group am-btn-group-xs">
            	<a  href="javascript:void(0);" onclick="balance()" id="balance_html"  class="am-btn am-btn-default hy-js-href"><span class="am-icon-plus"></span> 结算</a>
            </div>
			<div class="am-btn-group am-btn-group-xs">
            	<a  href="javascript:void(0);" onclick="export_excel()" id="export_html"  class="am-btn am-btn-default hy-js-href"><span class="am-icon-plus"></span> 导出Excel</a>
            </div>
		</div>
		</div>
		<div class="am-u-md-6 am-cf">
        <div class="am-fl am-cf">
          <div class="am-btn-toolbar am-fl">
			<div class="am-btn-group am-btn-group-xs" style="line-height:31px;margin-left:60px;" >
				每日的<strong style="font-size:18px;color:#0e90d2">{$total.startTime} </strong>到<strong style="font-size:18px;color:#0e90d2">{$total.endTime} </strong>
				<br>
				总pv总数<strong style="font-size:18px;color:#0e90d2"> {$total.pvcount|default:'0'} </strong>
				<br>
				总uv总数<strong style="font-size:18px;color:#0e90d2"> {$total.uvcount|default:'0'} </strong>
			</div>
				<br>
          </div>
		   
        </div>
      </div>
	  
      <div class="am-g">
      <div class="am-u-sm-12">
        <div class="am-form">
          <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
              <tr>
              	<th width="10%" class="table-check"><input class="hy-js-selectall" type="checkbox" />全选/全不选</th>
				<th width="30%" class="table-type">时间段</th>
				<th width="25%" class="table-type">pv</th>
				<th width="25%" class="table-type">uv</th>
				<th width="10%" class="table-type">当天详情</th>
              </tr>
          </thead>
          <tbody>
          	   <!--{foreach key=key from=$sql_list item=sql}-->
            <tr>
              <td><input class="hy-js-id" name="ids" type="checkbox" data-temp-status="{$sql.status}"  value="{$sql.id}"/></td>
              <td>{$sql.time|date_format:'Y-m-d'}</td>
              <td>{$sql.pvnumber|default:"0"}</td>
			  <td>{$sql.uvnumber|default:"0"}</td>
			  <td>
				<div class="am-btn-toolbar">
					<div class="am-btn-group am-btn-group-xs">
						 <button data-id="lookpu_{$sql.time}" data-href="index.php?g=admin&m=chat&a=lookpu&time={$sql.time}" class="am-btn am-btn-default am-btn-xs am-text-secondary hy-js-href"><span class="am-icon-pencil-square-o"></span> 查看</button>
					</div>
			  	</div>
			  </td>
            </tr>
                  <!--{/foreach}-->  
          </tbody>
        </table>
          <div class="am-cf">

  <div class="am-fr">
  {$list_page}
  </div>
</div>
          <hr />
      
        </div>
      </div>

    </div>
    </div>
   {include file='../Common/hy_footer.html'}
   <script type="text/javascript" src="{$_C.hy_path}js/Map.js"></script>
   <script type="text/javascript" src="{$_C.hy_path}js/bin.select.js"></script>
   <script src="{$_C.hy_path}js/jquery.confirm.js"></script>
   <script type="text/javascript" src="{$_C.hy_path}js/laydate/laydate.js"></script>
   <script type="text/javascript">
	
	$('.bin-select-searchbtn').click(function(){
		var url = window.location.href;
           url = url.substring(0,url.indexOf("?"));
		   url+="?g=admin&m=chat&a=visitor";
		var json = uriJson(bulidFilterParams($("#formsearch")));
		if(json!=""&&json!=null&&json!=undefined){
			window.location.href=url+"&"+json;
		}
	});
	function loadPage(where){
		var url = window.location.href;
           url = url.substring(0,url.indexOf("?"));
		   url+="?g=admin&m=chat&a=visitor";
		var json = uriJson(bulidFilterParams($("#formsearch")));
		if(json!=""&&json!=null&&json!=undefined){
			window.location.href=url+"&"+json+where;
		}else{
			window.location.href=url+where;
		}
	}
	
	function balance(){
		$("#balance_html").html("<span class='am-icon-plus'></span> 结算中...");
		var url ="/ws/index.php?g=admin&m=chat&a=balance";
		$.post(url,"",function(res){
			if(res.error==0){
				window.location.href="index.php?g=admin&m=chat&a=visitor";
				//window.history.go(0);
			}else{
				alert(res.content);
			}
			$("#balance_html").html("<span class='am-icon-plus'></span>  结算");
		},'json')
	}
	
	function export_excel(){
		$("#export_html").html("<span class='am-icon-plus'></span> 导出中...");
		var json = uriJson(bulidFilterParams($("#formsearch")));
		var url ="/ws/index.php?g=admin&m=chat&a=export_pv_uv"+"&"+json;
		window.location.href=url;
		$("#export_html").html("<span class='am-icon-plus'></span> 导出Excel");
//		$.post(url,"",function(res){
//			if(res.error==0){
//				$("#export_html").html("<span class='am-icon-plus'></span> 导出成功");
//			}else{
//			}
//			setTimeout("$('#export_html').html('<span class=\"am-icon-plus\"></span>  导出')",2000);			
//		},'json')
	}
	</script>
	</body>
</html>
